package com.bionic.CES.beans;

import java.io.Serializable;

public class User implements Serializable {

    protected Integer userId;
    protected String name;
    protected String surName;
    protected String email;
    protected String password;
    protected String adress;
    protected String telephone;
    private String status;


    public User() {
        this.setStatus("USER");
    }

    public User(Integer userId, String name, String surName, String email,
            String password, String adress, String telephone,
            String status) {
        this.userId = userId;
        this.name = name;
        this.surName = surName;
        this.email = email;
        this.password = password;
        this.adress = adress;
        this.telephone = telephone;
        this.status = status;
    }

    public Integer getUserid() {
        return userId;
    }

    public void setUserid(int userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSurName() {
        return surName;
    }

    public void setSurName(String surName) {
        this.surName = surName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAdress() {
        return adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getStatus() {
        return status;
    }

    public void setSystemAcc(String status) {
        this.setStatus(status);
    }

   
    @Override
    public String toString() {
        return "user [userId=" + userId + ", name=" + name + ", surName="
                + surName + ", email=" + email + ", password=" + password
                + ", adress=" + adress + ", telephone=" + telephone
                + ", status=" + status  + "]";
    }
    
    @Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((adress == null) ? 0 : adress.hashCode());
		result = prime * result + ((email == null) ? 0 : email.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result
				+ ((password == null) ? 0 : password.hashCode());
		result = prime * result + ((status == null) ? 0 : status.hashCode());
		result = prime * result + ((surName == null) ? 0 : surName.hashCode());
		result = prime * result
				+ ((telephone == null) ? 0 : telephone.hashCode());
		//result = prime * result + userId;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof User))
			return false;
		User other = (User) obj;
		if (adress == null) {
			if (other.adress != null)
				return false;
		} else if (!adress.equals(other.adress))
			return false;
		if (email == null) {
			if (other.email != null)
				return false;
		} else if (!email.equals(other.email))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (password == null) {
			if (other.password != null)
				return false;
		} else if (!password.equals(other.password))
			return false;
		if (status == null) {
			if (other.status != null)
				return false;
		} else if (!status.equals(other.status))
			return false;
		if (surName == null) {
			if (other.surName != null)
				return false;
		} else if (!surName.equals(other.surName))
			return false;
		if (telephone == null) {
			if (other.telephone != null)
				return false;
		} else if (!telephone.equals(other.telephone))
			return false;
//		if (userId != other.userId)
//			return false;
		return true;
	}

    /**
     * @param status the status to set
     */
    public void setStatus(String status) {
        this.status = status;
    }
}
